<template>
  <div style="padding: 10px;">
    <h3 style="margin: 20px">共计 <span v-text="total"></span> 票运单</h3>
    <Table style="width:100%;margin: 20px auto;" :columns="columns1" :data="data1"></Table>
  </div>
</template>

<script>
import axios from "axios";

export default {
  data(){
    return{
      id : this.$route.query.id,
      total : 1,
      columns1: [
        {
          title: '序号',
          type: 'index',
          width: 100,
          align: 'center'
        },
        {
          title: '运单编号',
          align: 'center',
          width: 180,
          key: 'id'
        },
        {
          title: '下单时间',
          align: 'center',
          width: 180,
          key: 'createTime'
        },
        {
          title: '发件人姓名',
          align: 'center',
          width: 180,
          key: 'senderName'
        },
        {
          title: '发件人电话',
          align: 'center',
          width: 160,
          key: 'senderPhone'
        },
        {
          title: '发件人地址',
          align: 'center',
          width: 180,
          key: 'senderAddress'
        },
        {
          title: '操作',
          width: 150,
          align: 'center',
          render: (h, params) => {
            return h('div', [
                h('Button', {
                  props: {
                    type: 'primary',
                    size: 'small',
                    to: {path:"/sp-logistics/sp-transport-order",query:{id: params.row.id}}
                  },
                  style: {
                    marginRight: '5px'
                  },
                }, '查看详情')])
          }

    }
      ],
      data1: []
    }
  },
  created(){
    this.queryTransportOrderInfo();
  },
  methods:{
    queryTransportOrderInfo: async function(){
      var rsp = await axios.post("/api/pd-workyc/pd-task-transport/queryTransportOrderByTaskId/"+this.id);
      // console.log(rsp.data);
      this.data1 = rsp.data;
      this.total = rsp.data.length;
    }
  }
}
</script>

<style scoped>

</style>
